package World;

import java.awt.Image;
import java.awt.image.BufferedImage;
import java.util.Random;

import javax.swing.ImageIcon;
import javax.swing.JOptionPane;

public class RGBNoise {
public static Random random = new Random();
	
	public static void main(String[] args){
	int width = 256;
	int height = 256;
	
	BufferedImage image = new BufferedImage(width,height, BufferedImage.TYPE_INT_RGB);
	int[] rgbs = new int[width*height];
	
	for(int y = 0; y < height; y++)
		for(int x = 0; x < width; x++){
			int i = x + y * width;
			rgbs[i] = random.nextInt();
		}
	image.setRGB(0, 0, width, height, rgbs, 0, width);
	JOptionPane.showMessageDialog(null, null, "More", JOptionPane.OK_OPTION, new ImageIcon(image.getScaledInstance(width * 2,  height * 2, Image.SCALE_AREA_AVERAGING)));
	}
	
}
